import request from '@/utils/request'

//展示所有文章
export const articleListService = (params)=>{
    return request.get('/article',{params:params});
}

//添加文章
export const addArticleService = (ArticleData)=>{
    return request.post('/article',ArticleData);
}

//修改文章
export const updateArticleService = (ArticleData)=>{
    return request.put('/article',ArticleData);
}

//删除文章
export const deleteArticleService = (id)=>{
    return request.delete('/article?id='+id)
}

//单篇文章
export const getArticleById = (id) => {
  return request.get('/article/'+id)
}